#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
    int num; char arr[3] = { 2,3,7 }, i = 0, j = 0;
    scanf("%d", &num);
    for (i; i < 3; i++)
    {
        if (num % arr[i] == 0)
        {
            printf("%d ", arr[i]);
            j = 1;
        }
    }
    if (j == 0)
        putchar('n');
}